import request from "@/api/index"

export default {
  /**
   * @description: 查询未配置接口 *代表必填
   * @param {Object} params *
   * @return {Object}
   */
  queryNotExistence (params) {
    const url = "/iot/dataType/queryNotExistence"
    return request.post(url, {
      ...params
    })
  },
  /**
   * @description: 查询已配置接口 *代表必填
   * @param {Object} params *
   * @return {Object}
   */
  queryExistence (params) {
    const url = "/iot/dataType/queryExistence"
    return request.post(url, {
      ...params
    })
  },
  /**
   * @description: 添加数据类别 *代表必填
   * @param {Object} params *
   * @return {Object}
   */
  add (params) {
    const url = "/iot/dataType/add"
    return request.post(url, {
      ...params
    })
  },
  /**
   * @description: 编辑数据类别 *代表必填
   * @param {Object} params *
   * @return {Object}
   */
  edit (params) {
    const url = "/iot/dataType/edit"
    return request.post(url, {
      ...params
    })
  },
  /**
   * @description: 批量删除数据类别 *代表必填
   * @param {String/Number} id *
   * @return {Object}
   */
  delListById (params) {
    const url = "/iot/dataType/delListById"
    return request.get(url, params)
  },
  /**
   * @description: 单个删除数据类别 *代表必填
   * @param {String/Number} id *
   * @return {Object}
   */
  delById (params) {
    const url = "/iot/dataType/delById"
    return request.get(url, params)
  },
  /**
   * @description: 主键查询数据类别 *代表必填
   * @param {String/Number} id *
   * @return {Object}
   */
  queryById (params) {
    const url = "/iot/dataType/queryById"
    return request.get(url, params)
  },
  /**
   * @description: 条件查询 *代表必填
   * @param {Object} params *
   * @return {Object}
   */
  queryByCondition (params) {
    const url = "/iot/dataType/queryByCondition"
    return request.post(url, {
      ...params,
      homeBaseId: sessionStorage.getItem("homeBaseId"),
    })
  },
  /**
   * @description: 分页查询数据类别 *代表必填
   * @param {Object} params *
   * @param {String/Number} page *
   * @param {String/Number} size *
   * @return {Object}
   */
  queryPageByCondition (params) {
    // params.entity ? '' : params.entity = {}
    // params.entity.homeBaseId = sessionStorage.getItem("homeBaseId")
    const url = "/iot/dataType/queryPageByCondition"
    return request.post(url, {
      ...params,
    })
  }
}